package com.zjl.service.impl;

import com.zjl.mapper.DeptLogMapper;
import com.zjl.pojo.DeptLog;
import com.zjl.service.DeptLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName DeptLogServiceImpl
 * @Description 部门表事务实现
 * @Author ZJL
 * @Date 2023/11/2 16:13
 * @Version 1.0
 **/
@Service
public class DeptLogServiceImpl implements DeptLogService {
    @Autowired
    private DeptLogMapper deptLogMapper;

    @Transactional //事务传播行为：有事务就加入、没有事务就新建事务
//    @Transactional(propagation = Propagation.REQUIRES_NEW)//事务传播行为：不论是否有事务，都新建事务
    @Override
    public void insert(DeptLog deptLog) {
        deptLogMapper.insert(deptLog);

    }
}
